﻿using Architecture.Domain.Service;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class UserRoleDeleteCommandHandler : IRequestHandler<UserRoleDeleteCommand, int>
    {
        private readonly IUserService _userService;

        public UserRoleDeleteCommandHandler(IUserService userService)
        {
            _userService = userService;
        }

        public async Task<int> Handle(UserRoleDeleteCommand request, CancellationToken cancellationToken)
        {
            return await _userService.UserRoleDel(request.id);
        }
    }
}
